﻿namespace OP10.ViewModels
{
    public class ST04DeviceManagerViewModel : BindableBase
    {
        private readonly IRegionManager _regionManager;

        public ST04DeviceManagerViewModel(IRegionManager regionManager)
        {
            _regionManager = regionManager;
        }



        #region 事件
        private DelegateCommand _GoBackCommand;

        public DelegateCommand GoBackCommand =>
            _GoBackCommand ?? (_GoBackCommand = new DelegateCommand(ExecuteGoBackCommand));

        void ExecuteGoBackCommand()
        {
            NavigationParameters param = new NavigationParameters();
            param.Add("StationName", "ST04");
            _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04View, param);
        }


        private DelegateCommand<string> _NavigateCommand;
        public DelegateCommand<string> NavigateCommand =>
            _NavigateCommand ?? (_NavigateCommand = new DelegateCommand<string>(ExecuteNavigateCommand));

        void ExecuteNavigateCommand(string parameter)
        {
            switch (parameter)
            {
                case "桥丝卷伺服":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04BridgeWireRollServoView);
                    break;
                case "桥丝转塔伺服":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04BridgeWireTowerServoView);
                    break;
                case "X轴伺服":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04XAxisServoView);
                    break;
                case "Y轴左伺服":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04YAxisLeftServoView);
                    break;
                case "Y轴右伺服":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04YAxisRightServoView);
                    break;
                case "左音圈电机校验":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04LeftMotorCheckView);
                    break;
                case "右音圈电机校验":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04RightMotorCheckView);
                    break;
                case "左音圈电机操作":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04LeftMotorOperateView);
                    break;
                case "右音圈电机操作":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04RightMotorOperateView);
                    break;
                case "电极针操作":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04ElectrodeNeedleOperateView);
                    break;
                case "电极针参数设置":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04ElectrodeNeedleConfigView);
                    break;
                case "焊接校准":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04WeldCheckView);
                    break;
                case "焊接测试":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04WeldTestView);
                    break;
                case "焊接参数显示":
                    _regionManager.RequestNavigate(PrismManager.MainViewRegionName, AppViews.ST04WeldParameterView);
                    break;
                default:
                    break;
            }

        }

        #endregion
    }
}
